LONDON (AP) — A British teen pleaded guilty Monday to murdering three girls and attempting to kill 10 other people in what a prosecutor said was a "meticulously planned" stabbing rampage at a Taylor Swift-themed dance class in England last summer.

The crime shocked Britain, and misinformation about the attacker sparked anti-immigrant violence across the country. The government announced it would hold an independent public inquiry into the attack, which was carried out by a U.K.-born teenager with a troubling fascination with violence.

Axel Rudakubana, 18, entered the surprise guilty pleas as jury selection had been expected to begin at the start of his trial in Liverpool Crown Court.

The July 29 stabbings led to a week of widespread rioting across parts of England and Northern Ireland after the suspect was falsely identified as an asylum-seeker who had recently arrived in Britain by boat. He was born in Wales to Rwandan parents.

Prime Minister Keir Starmer welcomed Rudakubana's conviction, but said it was “a moment of trauma for the nation.”

“There are grave questions to answer as to how the state failed in its ultimate duty to protect these young girls," he said. “Britain will rightly demand answers, and we will leave no stone unturned in that pursuit.”

U.K. Home Secretary Yvette Cooper said that a public inquiry would "get to the truth about what happened and what needs to change.”

The attack occurred on the first day of summer vacation when the little girls at the Hart Space, a sanctuary hidden behind a row of houses, were in a class to learn yoga and dance to the songs of Taylor Swift. What was supposed to be a day of joy turned to terror and heartbreak when Rudakubana, armed with a knife, intruded and began stabbing the girls and their teacher in the seaside town of Southport in northwest England.

“This was an unspeakable attack — one which left an enduring mark on our community and the nation for its savagery and senselessness," Deputy Chief Crown Prosecutor Ursula Doyle said. “A day which should have been one of carefree innocence; of children enjoying a dance workshop and making friendship bracelets, became a scene of the darkest horror as Axel Rudakubana carried out his meticulously planned rampage.”

Prosecutors haven’t said what they believe led Rudakubana — who was days shy of his 18th birthday — to commit the atrocities, but Doyle said that it was clear he had a “a sickening and sustained interest in death and violence.”

Rudakubana had consistently refused to speak in court and did so once again when asked to identify himself at the start of the proceedings. But he broke his silence when he was read the 16-count indictment and asked to enter a plea, replying “guilty” to each charge.

He pleaded guilty to three counts of murder, 10 counts of attempted murder and additional charges related to possessing the poison ricin and for having an al-Qaida manual.

Rudakubana faces life imprisonment when sentenced Thursday, Justice Julian Goose said.

Defense lawyer Stanley Reiz said that he would present information to the judge about Rudakubana's mental health that may be relevant to his sentence.

The surviving victims and family members of those killed were absent in court, because they had expected to arrive Tuesday for opening statements.

Goose asked the prosecutor to apologize on his behalf that they weren't present to hear Rudakubana plead guilty.

He pleaded guilty to murdering Alice Da Silva Aguiar, 9, Elsie Dot Stancombe, 7, and Bebe King, 6.

Eight other girls, ranging in age from 7 to 13, were wounded, along with instructor Leanne Lucas and John Hayes, who worked in a business next door and intervened. Fifteen other girls, as young as 5, were at the class but uninjured. Under a court order, none of the surviving girls can be named.

Hayes, who was stabbed and seriously wounded, said he still had flashbacks to the attack and was “hugely upset at the time that I wasn’t able to do more.”

“But I did what I could in the circumstances,” he told Sky News. “I’m grateful to be here, and by all accounts I’ll make a full recovery, at least physically. … I’m going to be OK and others won’t be, and that’s really where I I think the focus of attention should be.”

Police said the stabbings weren’t classified as acts of terrorism because the motive wasn’t known.

Several months after his arrest at the scene of the crime, Rudakubana was charged with additional counts for production of a biological toxin, ricin and possession of information likely to be useful to a person committing or preparing to commit an act of terrorism for having the manual in a document on his computer.

Police said they found the evidence during a search of his family's home in a neighboring village.

The day after the killings — and shortly after a peaceful vigil for the victims — a violent group attacked a mosque near the crime scene and pelted police officers with bricks and bottles and set fire to police vehicles.

Rioting then spread to dozens of other towns over the next week when groups made up mostly of men mobilized by far-right activists on social media clashed with police during violent protests and attacked hotels housing migrants.

More than 1,200 people were arrested for the disorder and hundreds have been jailed for up to nine years in prison.

In this Court artist sketch by Elizabeth Cook, Southport stabbings suspect Axel Rudakubana appears on the first day of his trial at Liverpool Crown Court, where he has pleaded guilty to killing three young girls and wounded 10 other people in a knife attack at a Taylor Swift-themed dance class, in Liverpool, England, Monday, Jan. 20, 2025. (Elizabeth Cook/PA via AP)

Credit: AP

icon to expand image

Credit: AP

This is an undated handout photo issued by Merseyside Police of Axel Rudakubana on Monday, Jan. 20, 2025, who has pleaded guilty at Liverpool Crown Court, England, to killing three girls and injuring others in a knife attack at a Taylor Swift-themed dance class. (Merseyside Police via AP)

Credit: AP

icon to expand image

Credit: AP

FILE - Tributes are seen outside the Town Hall in Southport, England, Aug. 5, 2024 after three young girls were killed in a knife attack at a Taylor Swift-themed holiday club the week before. (AP Photo/Darren Staples, File)

Credit: AP

icon to expand image

Credit: AP

FILE - Police officers watch members of the public outside the Town Hall in Southport, England, Aug. 5, 2024 after three young girls were killed in a knife attack at a Taylor Swift-themed holiday club the week before. (AP Photo/Darren Staples, File)

Credit: AP

icon to expand image

Credit: AP

A prison van believed to contain Axel Rudakubana arrives at Liverpool Crown Court in Liverpool, England, Monday, Jan. 20, 2025 where Rudakubana is charged with killing three girls and wounding 10 other people in a stabbing rampage at a Taylor Swift-themed dance class in England last summer.(AP Photo/Jon Super)

Credit: AP

icon to expand image

Credit: AP

A prison van believed to contain Axel Rudakubana arrives at Liverpool Crown Court in Liverpool, England, Monday, Jan. 20, 2025 where Rudakubana is charged with killing three girls and wounding 10 other people in a stabbing rampage at a Taylor Swift-themed dance class in England last summer.(AP Photo/Jon Super)

Credit: AP

icon to expand image

Credit: AP

People queue at Liverpool Crown Court in Liverpool, England, Monday, Jan. 20, 2025 where Axel Rudakubana is charged with killing three girls and wounding 10 other people in a stabbing rampage at a Taylor Swift-themed dance class in England last summer.(AP Photo/Jon Super)

Credit: AP

icon to expand image

Credit: AP

A prison van believed to contain Axel Rudakubana leaves Liverpool Crown Court in Liverpool, England, Monday, Jan. 20, 2025 where Rudakubana is charged with killing three girls and wounding 10 other people in a stabbing rampage at a Taylor Swift-themed dance class in England last summer.(AP Photo/Jon Super)

Credit: AP

icon to expand image

Credit: AP

Media waits outside Liverpool Crown Court in Liverpool, England, Monday, Jan. 20, 2025 where Axel Rudakubana is charged with killing three girls and wounding 10 other people in a stabbing rampage at a Taylor Swift-themed dance class in England last summer.(AP Photo/Jon Super)

Credit: AP

icon to expand image

Credit: AP

An escorted prison van believed to contain Axel Rudakubana leaves Liverpool Crown Court in Liverpool, England, Monday, Jan. 20, 2025 where Rudakubana is charged with killing three girls and wounding 10 other people in a stabbing rampage at a Taylor Swift-themed dance class in England last summer.(AP Photo/Jon Super)

Credit: AP

icon to expand image

Credit: AP

Protesters hold banners near Liverpool Crown Court in Liverpool, England, Monday, Jan. 20, 2025 where Axel Rudakubana is charged with killing three girls and wounding 10 other people in a stabbing rampage at a Taylor Swift-themed dance class in England last summer.(AP Photo/Jon Super)

Credit: AP

icon to expand image

Credit: AP

An escorted prison van believed to contain Axel Rudakubana leaves Liverpool Crown Court in Liverpool, England, Monday, Jan. 20, 2025 where Rudakubana is charged with killing three girls and wounding 10 other people in a stabbing rampage at a Taylor Swift-themed dance class in England last summer.(AP Photo/Jon Super)

Credit: AP

icon to expand image

Credit: AP